<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title>
</title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<link rel="stylesheet" href="../css/ui-base.css">
	<link rel="stylesheet" href="../css/ui-box.css">
	<link rel="stylesheet" href="../css/ui-input.css">
	<link rel="stylesheet" href="../css/project/style.css">
	<link rel="stylesheet" href="css/ele_comment.css">
	<script src="../js/zy_control.js"></script>
	<script src="../js/zy_click.js"></script>
	<script src="../js/saplife.js"></script>
</head>
<body class="um-vp c-wh2" ontouchstart>
	<div class="uinn-a1">
		
		<div class="ub ub-ac umar-at1">
			<div class="t-gra-82 ulev-4">文章标题</div>
		</div>
		<div class="umar-t-ec2">
			<div class="c-wh uinn-ec1 uh-ect">
                <div class="uinput" >
                    <textarea placeholder="在这里添加文章标题" name="textarea-0" ></textarea>
                </div>
			</div>
		</div>
		<div class="ub ub-ac umar-at1">
			<div class="t-gra-82 ulev-4">文章内容</div>
		</div>
		<div class="umar-t-ec2">

			<div class="c-wh uinn-ec1 uh-ect">
                <div class="uinput">
                    <textarea placeholder="在这里添加文章内容" name="textarea-1" class="ec-fs t-gra-82"></textarea>
                </div>
				<div class="t-wh-c7 ulev-2 ub-pe ub-ae tx-r">还可以输入500个字</div>
			</div>
		</div>
        <div class="ub ub-ver">
            <div class="uinn-at1">
                <div ontouchstart="zy_touch('btn-act')" onclick="addArticle()" class="uinn-a2 btn_hei1 c-blu uc-a1 t-wh tx-c">
                    提交
                </div>
            </div>
        </div>
	</div>

</body>
<script>
zy_init();
window.uexOnload=function(type){
	if(!type){
		uexWindow.setBounce("1");
		uexWindow.showBounceView("0", "rgba(255,255,255,0)", "0");
        uexWindow.showBounceView("1", "rgba(255,255,255,0)", "0");
	}
}

function addArticle(){
	//var logname = document.getElementById('uid').value;
	var title= "SAP Life 发表文章测试2";
	var content = "SAP Life 发表文章测试，不好意思啦！";
	var refer = "";
	var tagsList = [];
    var url = articleApiUrl + "/index";
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function(result){
        if (xhr.readyState == 4) {
            var responseText = xhr.responseText;
            var response = JSON.parse(responseText);
			if (response.ack == false) {
				alert("fail!!");	
			}
        }
    };
    xhr.open("POST", url, true);
    xhr.setRequestHeader("Accept", "application/json, text/plain, */*");
    xhr.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    xhr.send("{\"content\":\""+content+"\",\"refer\":\"" + refer + "\",\"tagsList\":\"" + tagsList + "\",\"title\":" + title + "}");
}


</script>
</html>
